package cc.yugu.yhdw.webserver.web.controller.security.hdw;

import cc.yugu.yhdw.common.annotation.ViewModel;
import cc.yugu.yhdw.common.domain.hdw.ExchangeOrderMoneyDivide;
import cc.yugu.yhdw.common.entity.json.PageResult;
import cc.yugu.yhdw.webserver.service.hdw.ExchangeOrderMoneyDivideService;
import cc.yugu.yhdw.webserver.web.controller.security.SecurityController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/security/hdw/exchange_order_money_divide")
public class ExchangeOrderMoneyDivideController extends SecurityController {
    @Autowired
    ExchangeOrderMoneyDivideService exchangeOrderMoneyDivideService;

    @RequestMapping("divide.htm")
    public void divide(String orderId,Model model) {
        model.addAttribute("orderId", orderId);
    }

    @RequestMapping(value = "page.htm")
    @ViewModel(ViewModel.JSON)
    @ResponseBody
    public PageResult page(ExchangeOrderMoneyDivide search) {
        return PageResult.successResult(exchangeOrderMoneyDivideService.findPage(search));
    }
}
